--- ams-2.1.2/configure.old	2016-11-05 22:20:32.871586260 +0000
+++ ams-2.1.2/configure	2016-11-05 22:20:46.776496504 +0000
@@ -6360,7 +6360,7 @@
 #define HAVE_LIBQTOPENGL 1
 _ACEOF
 
-  LIBS="-lQtOpenGL $LIBS"
+  LIBS=" -lQtOpenGL $LIBS"
 
 else
   as_fn_error $? "QtOpenGL is required" "$LINENO" 5
